package com.floreantpos;

import java.io.UnsupportedEncodingException;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Messages {

  private static final String BUNDLE_NAME = "messages";

  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);

  private Messages() {
  }

  public static Object getString(String key) {
    try {
      return new String(RESOURCE_BUNDLE.getString(key).getBytes("ISO-8859-1"), "UTF-8");
    } catch (UnsupportedEncodingException ex) {
      Logger.getLogger(Messages.class.getName()).log(Level.SEVERE, null, ex);
      return '!' + key + '!';
    }
  }
}
